package leetcode.code713;

public class Solution extends Solution713 {

	@Override
	public int numSubarrayProductLessThanK(int[] nums, int k) {
		int left = 0;
		int right = 0;
		int count = 0;
		int product = 1;
		while (right < nums.length) {
			product *= nums[right];
			while (product >= k && left <= right) {
				product /= nums[left];
				left++;
			}
			count += right - left + 1;
			right++;
		}
		return count;
	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();
	}

}
